-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: makes instance-status works along with Moleculer lifecyle #34134
base: develop
Are you sure you want to change the base?
Conversation
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #34134 +/- ##
===========================================
+ Coverage 75.75% 75.79% +0.03%
===========================================
Files 510 511 +1
Lines 22078 22132 +54
Branches 5387 5394 +7
===========================================
+ Hits 16726 16775 +49
- Misses 4706 4709 +3
- Partials 646 648 +2
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
Proposed changes (including videos or screenshots)
This PR removes the use of MongoDB Change Streams on
instance-status
package. The removal of Change Stream items is part of an initiative started earlier this year, but resources related toinstance-status
were still pending.instance-status
is responsible for ensuring the connection and heartbeat between instances in a multi-instance monolithic Rocket.Chat deployment.Since the Moleculer framework is already in use, we moved the lifecycle management of connections to it, such as node initialization, listing, etc.
As a result, it is no longer necessary to ping MongoDB and wait for a Change Stream notification to interpret a given node as valid.
The same timeout and heartbeat interval rules have been added to Moleculer:
process.env.MULTIPLE_INSTANCES_PING_INTERVAL || 10
process.env.MULTIPLE_INSTANCES_EXPIRE || Math.ceil((defaultPingInterval * 3) / 60) * 60
Issue(s)
Steps to test or reproduce
To validate these changes, you will need to run a multi-instance monolithic Rocket.Chat deployment.
Navigate to the
apps/meteor
directory and run the following command to start the first instance:cd apps/meteor TEST_MODE=true CI=true DISABLE_DB_WATCHERS=true meteor
Navigate to the build directory and execute the following:
This setup runs multi-instance communication using the TCP transporter. If you prefer to use NATS, you’ll need to include the NATS_TRANSPORTER environment variable. However, the changes primarily affect TCP connections.
Further comments